import {HTTP} from "../../../utils/http.js";
import { formatDate} from "../../../utils/util.js";

var http = new HTTP();
var _self ;
Page({

  /**
   * 页面的初始数据
   */
  data: {
      eduList:null
  },
  onLoad: function (options) {
    _self = this;
    this.getInitData();

  },
  changeData:function(){
    this.getInitData();
  },
  onShareAppMessage: function () {

  },
  getInitData:function(){
    http.request({
      url:"/usr/educationalExperience",
      method:"POST",
      success:function(data){
        console.log("我的学历信息接口：",data);
        _self.setData({
           eduList:data
        })
      }
    })
  },
  addEduExp:function(e){
    http.request({
      url: "/usr/addEducationalExperience",
      data:data,
      method: "POST",
      success: function (data) {
        console.log(data)
      }
    })
  },
  editEdu:function(e){
    let json = this.data.eduList[e.currentTarget.dataset.current];
    if (json.useForRealName!='1'){
      wx.navigateTo({
        url: '/pages/profile/education/edit/index?type=edit&current=' + JSON.stringify(json)
      })
    }
     
  }


})